<template>
状态管理的变量：{{ count }}
<button @click="increment">修改状态管理的变量值</button>
<button @click="router.push('/study/piniaother')">跳转到另一个pinia页面</button>
</template>

<script lang="ts" setup>
//使用pinia定义的方法和变量
import { storeToRefs } from 'pinia';
import store from '../../store/index';

//路由api
import { useRouter } from 'vue-router';
const router = useRouter();

const { count } = storeToRefs(store());
//actions
const { increment } = store()
</script>

<style lang="scss" scoped>
</style>
